<template>
  <div class="home">
    <div class="navheaders">
      <van-nav-bar>
        <template #title>
          <span>
            <img src="../../assets/img/logo.png" />
          </span>
        </template>
      </van-nav-bar>
    </div>
    <div class="title">{{this.name}}</div>
    <div class="content" v-html="content">
      <!-- {{this.content}} -->
    </div>
  </div>
</template>

<script>
import axios from 'axios'
export default {
  data () {
    return {
      name: '',
      content: ''
    }
  },
  methods: {
    getData () {
      let id = this.$route.params.id
      axios.get('https://www.zsrencai.cn/zsrencai/api/ms/news-menu/' + id).then((res) => {
        let data = res.data.data
        this.name = data.name
        this.content = decodeURI(data.content)
      })
    }
  },
  created () {
    this.getData()
  }
}
</script>

<style>
.title {
  color: #000;
  font-weight: 700;
  margin: 30px auto;
  width: 80%;
}

.txt {
  line-height: 40px;
  font-size: 20px;
}
.content {
  width: 85%;
  margin: 20px auto;
}
</style>
